package com.postsuperman.proxypool.service.zm;

import cn.hutool.core.bean.BeanUtil;
import com.postsuperman.proxypool.common.http.HttpManager;
import com.postsuperman.proxypool.parser.ZmProxyParser;
import com.postsuperman.proxypool.pojo.HttpProxy;
import com.postsuperman.proxypool.service.BaseHttpProxyService;
import com.postsuperman.proxypool.service.HttpProxyService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author ： postsuperman
 * Created by 11:24 on 2019/2/26.
 */
@Service
public class ZmProxyService extends BaseHttpProxyService implements HttpProxyService {

    @Override
    public List<HttpProxy> get() {
        try {
            Map<String, Object> mapParam = BeanUtil.beanToMap(new ParamInfo());
            //执行获取动态代理IP操作
            String result = HttpManager.get("http://webapi.http.zhimacangku.com/getip", mapParam);
            return new ZmProxyParser().parser(result);
        } catch (Exception ex) {
        }
        return null;
    }
}
